﻿<%@ Page Title="" Language="C#" MasterPageFile="~/Views/Shared/Site.Master" AutoEventWireup="true" CodeBehind="Search.aspx.cs" Inherits="MyMovieCollection.Views.Product.Search" %>
<%@ Import Namespace="MyMovieCollection.DATA.Models"%>

<%@ Import Namespace="MyMovieCollection.Controllers"%>
<asp:Content ID="Content1" ContentPlaceHolderID="MainContent" runat="server">
 <script>
function SortAction(actionName)
{
    var value=document.getElementById("Movie_Type").value;
    window.location.href="/Product/"+actionName+"/"+ value+"/Search";
}
function OpenBigPoster(poster,movieName)
{
    window.open("/Product/ShowBig/"+poster+"/"+movieName,null,'height=1,width=1,scroll=no,toolbar=no,statusbar=no,addressbar=no,titlebar=no,TOOLBAR=no,menubar=no');
}
</script>
 <form method="post"  action="/Product/SearchMovie">
    <table width="100%">    
        <tr>
            <td width="10%">Adı</td>
            <td width="40%"><input id="Name" name="Name" type="text" Value="<%=ViewData["Search_Selected_Name"] %>" /></td>
            <td width="10%">Yılı</td>
            <td width="40%"><input id="Year" name="Year" type="text"  Value="<%=ViewData["Search_Selected_Year"] %>" /></td>
        </tr>
        <tr>
            <td width="10%">Puna Skalası</td>
            <td width="40%"><%= Html.DropDownList("Point_Scale") %></td>
            <td width="10%">Türü</td>
            <td width="40%"><%= Html.DropDownList("Movie_Type")%></td>            
        </tr>
        <tr>
            <td colspan="4"><input  type="submit" value="Ara"  /></td>
        </tr>
        <tr><td colspan="4"></td></tr>
        <tr><td colspan="4"></td></tr>
        <tr><td colspan="4"></td></tr>
        <tr>
           <td ColSpan="4">
             <table width="100%">
                    <tr>
                    <td width="25%"><strong>ADI</strong></td>
                    <td width="10%"><strong>YILI</strong></td>
                    <td width="10%"><strong>PUANI</strong></td>
                    <td width="20%" ><strong>KATEGORİ</strong></td>
                    <td width="35%" align="center"><strong>AFİŞ</strong></td>

                    </tr>
                    <%
                        foreach(Movie movie in ((List<Movie>) ViewData["Movies"]))
                        {
                            %>
                            <tr>
                                <td width="25%"><%=movie.Name %></td>
                                <td width="15%"><%=movie.Year %></td> 
                                <td width="15%"><%=movie.Point %></td> 
                                <td width="20%"><%=movie.Movie_Type.TypeName%></td> 
                                <td width="35%" align="center"><img width="100" height="100" title="<%=movie.Name%>" src="../../Content/Upload/<%=movie.Poster%>" onclick="OpenBigPoster('<%=movie.Poster%>','<%=movie.Name%>');" onmouseover="this.style.cursor='hand';" /></td>
                            </tr>
                            <%
                            
                        }
                         %>
                      <tr>
                      <td colspan="4" ></td>
                      </tr>
                </table>
            </td>
        </tr>
    </table>
  </form>
</asp:Content>
